package com.wang.designpattern.strategy;

import com.wang.designpattern.strategy.behavior.GagaQuackBehavior;
import com.wang.designpattern.strategy.behavior.GoodFlyBehavior;

public class WildDuck extends Duck {

    // 构造器，传入FlyBehavior的对象
    public WildDuck() {
        flyBehavior = new GoodFlyBehavior();
        quackBehavior = new GagaQuackBehavior();
    }

    @Override
    public void display() {
        System.out.println("这是野鸭 ");
    }
}
